import { FontAwesome } from '@expo/vector-icons'
import { Tabs } from 'expo-router'
import { useEffect, useState } from 'react'

const TabLayout = () => {
	const [count, setCount] = useState(0)
	useEffect(() => {
		setTimeout(() => {
			console.log(11111111, count)
			setCount(count + 1)
		}, 2000)
	}, [])
	return (
		<Tabs screenOptions={{ tabBarActiveTintColor: 'blue' }}>
			<Tabs.Screen
				name='index'
				options={{
					title: '首页',
					headerTitleAlign: 'center',
					headerTitleStyle: {
						fontSize: 14,
					},
					tabBarBadge: count,
					tabBarIcon: ({ color }) => <FontAwesome name='home' size={24} color={color} />,
				}}></Tabs.Screen>
			<Tabs.Screen
				name='my'
				options={{
					headerShown: false,
					title: '我的',
					tabBarIcon: ({ color }) => <FontAwesome name='user' size={24} color={color} />,
				}}></Tabs.Screen>
		</Tabs>
	)
}

export default TabLayout
